<template>
	<view>
		<view class="top">
			<view class="top-pos">
				<!-- 粘性定位 -->
				<view>&lt;</view>
				<view>搜索框</view>
				<view>收藏</view>
			</view>
		</view>
		<view class="buttom">
			<view class="shop-card">
				<!-- 店铺卡片 -->
				<shop-info></shop-info>
			</view>
			<view class="shop-tab">tab页</view>
			<view>
				<!-- 分类展示 -->
				<category-dish :category_list='category_list'></category-dish>
			</view>
		</view>
		<view class="cart">
			<add-cart></add-cart>
		</view>


	</view>
</template>

<script>
	import {category_list} from '@/api/shop.js'
	export default {
		onLoad(data) {
			console.log(data.id)
			category_list(data.id).then(res => {
				console.log(res)
				this.category_list = res
			})
		},
		data() {
			return {
				category_list: []
			}
		},
		methods: {

		}
	}
</script>

<style scoped>
	.top {
		height: 300upx;
		background-color: #c68a8a;
	}

	.buttom {
		position: relative
	}

	.top-pos {
		display: flex;
		position: absolute;
		left: 40upx;
		top: 50upx
	}

	.shop-card {
		width: 100%;
		position: relative;
		top: -100upx;
	}

	.shop-tab {
		position: relative;
		margin-top: -100upx;
	}

	.cart {
		width: 100%;
		position: fixed;
		bottom: 0;
		left: 0;
	}
</style>